<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>03_JS的数据类型</title>
</head>
<body>
<script>
    var a = 1;
    var b = 3.14;
    console.log(typeof a, typeof b);
    var c = "hello";
    var d = 'world';
    console.log(typeof c, typeof d);
    var e = true;
    var f = false;
    console.log(typeof e, typeof f);
    console.log(typeof g);
    let obj ={};
    console.log(obj);
    console.log(typeof obj);
    obj.name = "张三";
    obj.age = 18;
    console.log(obj);
    console.log(obj.name, obj.age);

    let obj2 = {
        name: "张三",
        age: 18
    };
    console.log(obj2);
    obj2.love = "football";
    console.log(obj2);
    console.log(obj2.name, obj2.age, obj2.like);
    console.log(obj2.play);

    let arr = [1,2.33,'3',true];
    console.log(arr);
    console.log(arr[0], arr[1], arr[2], arr[3]);
    console.log(arr[100]);

    console.log(Number(true))
    console.log(Number(false))
    console.log(Number('123'))
    console.log(Number('23.23'))
    console.log(Number("哈哈哈哈"))

    console.log(Boolean(0))
    console.log(Boolean(null))
    console.log(Boolean(undefined))
    console.log(Boolean(NaN))
    console.log(Boolean(''))
    console.log(Boolean('hhhh'))
    console.log(Boolean(' '))
    console.log(Boolean(1))

</script>
</body>
</html>

















